using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
namespace BMC.ARSystem
{
	[TypeConverter(typeof(ExpandableObjectConverter)), ClassInterface, ComVisible(false), Guid("91a6d55d-fb26-4b5e-a625-68290b76cb75"), ProgId("BMC.ARSystem.Action")]
	public abstract class Action
	{
		internal static Action createInstance(object[] rawData, Server server)
		{
			server.Session.CurrentActionIndex++;
			int[] indexSpec = new int[1];
			uint num = Convert.ToUInt32(Util.GetAt(rawData, indexSpec));
			if (server.Session.CurrentObjectType == Server.ObjectType.ActiveLink)
			{
				switch (num)
				{
				case 0u:
					return null;
				case 1u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(RunMacroAction), rawData[1], server);
				case 2u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(SetFieldsAction), rawData[1], server);
				case 3u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(RunProcessAction), new object[]
					{
						rawData[1]
					}, server);
				case 4u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(MessageAction), rawData[1], server);
				case 5u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(ChangeFieldAction), rawData[1], server);
				case 6u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(DDEAction), rawData[1], server);
				case 7u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(PushFieldsAction), rawData[1], server);
				case 8u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(DirectSqlAction), rawData[1], server);
				case 9u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(OleAutomationAction), rawData[1], server);
				case 10u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(OpenWindowAction), rawData[1], server);
				case 11u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(CommitChangesAction), rawData[1], server);
				case 12u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(CloseWindowAction), rawData[1], server);
				case 13u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(CallGuideAction), rawData[1], server);
				case 14u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(ExitGuideAction), rawData[1], server);
				case 15u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(GotoGuideLabelAction), rawData[1], server);
				case 16u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(WaitAction), rawData[1], server);
				case 17u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(GotoAction), rawData[1], server);
				case 18u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(ServiceAction), rawData[1], server);
				}
			}
			else
			{
				switch (num)
				{
				case 0u:
					return null;
				case 1u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(NotifyAction), rawData[1], server);
				case 2u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(FilterMessageAction), rawData[1], server);
				case 3u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(LogAction), new object[]
					{
						rawData[1]
					}, server);
				case 4u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(SetFieldsAction), rawData[1], server);
				case 5u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(RunProcessAction), new object[]
					{
						rawData[1]
					}, server);
				case 6u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(PushFieldsAction), rawData[1], server);
				case 7u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(DirectSqlAction), rawData[1], server);
				case 8u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(GotoAction), rawData[1], server);
				case 9u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(CallGuideAction), rawData[1], server);
				case 10u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(ExitGuideAction), rawData[1], server);
				case 11u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(GotoGuideLabelAction), rawData[1], server);
				case 12u:
					return (Action)ARTypeMgr.Instance.ObjectFromVariant(typeof(ServiceAction), rawData[1], server);
				}
			}
			return null;
		}
	}
}
